home *** CD-ROM | disk | FTP | other *** search
- Path: magnus.acs.ohio-state.edu!news
- From: Xiaoyi Wu <xiaoyi@mozart.bme.ohio-state.edu>
- Newsgroups: comp.lang.c
- Subject: Re: Checking For Keyboard Input
- Date: Mon, 26 Feb 1996 12:13:21 -0500
- Organization: The Ohio State University
- Message-ID: <3131EA31.167E@mozart.bme.ohio-state.edu>
- References: <cerebus.34.000DD98A@voicenet.com> <4gqriq$qf2@maureen.teleport.com>
- NNTP-Posting-Host: mozart.bme.ohio-state.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=gb2312
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.3 IP22)
-
- GHouck wrote:
- >
- > cerebus@voicenet.com (aLEX) wrote:
- > >Hello fellow C programmers,
- > > Is there anyway to check if keyboard input has been entered without
- > >actually stalling the excution of the code until the user presses a key. I
- > >would really like to do this but I can't seem to find any way. If you know of
- > >a way PLEASE email me or post it. Thank you in advance.
- > > aLEX
- > > cerebus@voicenet.com
- > aLEX,
- > There is if you're using Borland on DOS/Windows: there is a function called
- > kbhit()
- > If a key has been hit, it returns a non-zero value, else it returns zero. If
- > one is available you can then get it with another call.
- > Yours, Geoff Houck
-
- What about Unix?
- --
- Xiaoyi
-
- /======================================================================\
- | Xiaoyi Wu || If you can't convince them, confuse them. |
- | 614-421-0934 (h) || xiaoyi@mozart.bme.ohio-state.edu |
- | 614-292-1555 (o) || http://chopin.bme.ohio-state.edu/~xiaoyi/hi.html|
- \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
-